package com.woniu.new_orange.personnel_model_wu.service.impl;

import com.woniu.new_orange.entity.OrderForm;
import com.woniu.new_orange.mapper.OrderFormMapper;
import com.woniu.new_orange.personnel_model_wu.Dto.OrderDto;
import com.woniu.new_orange.personnel_model_wu.VO.OrderVo;
import com.woniu.new_orange.personnel_model_wu.service.OrderFormService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Program: new_orange->OrderFormServiceImpl
 * @Description:
 * @Author: 13488
 * @Date: 2023-02-02 18:54
 * @Version： 1.0
 **/
@Service
public class OrderFormServiceImpl implements OrderFormService {
    @Resource
    private OrderFormMapper orderFormMapper;
    @Override
    public List<OrderVo> selectAll(OrderDto order) {
        return orderFormMapper.selectAll(order);
    }

    @Override
    public int deleteByPrimaryKey(Long id) {
        return 0;
    }

    @Override
    public int insert(OrderForm record) {
        return 0;
    }

//zhang
    int i = 122;

    @Override
    public int insertSelective(OrderForm orderForm) {
        String s = new String(String.valueOf(i));
        orderForm.setOrderFormNo(orderForm.getUserId()+s);
        i++;
        orderForm.setOrderFormState(0);
        return orderFormMapper.insertSelective(orderForm);
    }

    @Override
    public OrderForm selectByPrimaryKey(Long id) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(OrderForm record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(OrderForm record) {
        return 0;
    }

    @Override
    public List<OrderVo> selectAllForC(Integer orderFormState) {
        return orderFormMapper.selectAllForC(orderFormState);
    }

    @Override
    public int updateByorderFormNo(OrderForm in) {
        return orderFormMapper.updateByorderFormNo(in);
    }

    @Override
    public List<OrderVo> selectByCustomizationStaffId(Integer customizationStaffId) {
        return orderFormMapper.selectByCustomizationStaffId(customizationStaffId);
    }


}
